package com.blazer.c;

public class methoddemo {
    public static void main(String[] args) {
        farmer();
        cook();
        sum();
        sum1(10,20);

     int summ=sum2(10,20);
        System.out.println(summ+"summ");
        int i=30;
        int j=20;
       boolean result= compare(i,j);
        System.out.println("result"+result);
    }
    public static void farmer(){
        System.out.println("farmer");
    }
    public static void cook(){
        System.out.println("cool");
    }
    public static void sum(){
        int a=10;
        int b=20;
        int sum=0;
        sum=a+b;
        System.out.println("sum"+sum);
    }
    public static  void  sum1(int a,int b){
        int sum=a+b;
        System.out.println(sum);
    }
    public static  int  sum2(int a,int b){
        int sum1=a+b;
        return sum1;
    }

    public static boolean compare(int a,int b){
        if(a>b){
            return true;
        }else{
            return false;
        }
    }
    //无参无返回值
    // public static void 方法名(){},
    //有参无返回值
    //public static void 方法名(int a,int b){}
    //有参有返回值
    //public static void 方法名(int a,int b){return 结果}

}
